<?php
if($_SERVER['REQUEST_METHOD'] != 'POST'){
	header('location:/');
}
include '../webadmin/inc/global.php';
class Request {
    public $get = array();
    public $post = array();
    public $cookie = array();
    public $files = array();
    public $server = array();
    public function __construct() {
            $this->get = $this->clean($_GET);
            $this->post = $this->clean($_POST);
            $this->request = $this->clean($_REQUEST);
            $this->cookie = $this->clean($_COOKIE);
            $this->files = $this->clean($_FILES);
            $this->server = $this->clean($_SERVER);
    }

    public function clean($data) {
            if (is_array($data)) {
                    foreach ($data as $key => $value) {
                            unset($data[$key]);
                            $data[$this->clean($key)] = $this->clean($value);
                    }
            } else {
                    $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
            }

            return $data;
    }
	public function escape($value) {
			$search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"');
			$replace = array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"');
			return str_replace($search, $replace, $value);
	}
}

$request = new Request();
if(!isset($request->post['zxjm'])){
	header('location:/');
}

$jobinfo = $request->post['zxjm'];
$key = 'sen_zxjm1,sen_zxjm5,sen_zxjm6,sen_zxjm7,sen_zxjm8,sen_zxjm9,sen_zxjm10';
$val = '"28","'.$request->escape($jobinfo['sen_zxjm5']).'","'.$request->escape($jobinfo['sen_zxjm6']).'","'.$request->escape($jobinfo['sen_zxjm7']).'","'.$request->escape($jobinfo['sen_zxjm8']).'","'.$request->escape($jobinfo['sen_zxjm9']).'","'.time().'"';
$insql = 'insert into sen_zxjm('.$key.')values('.$val.')';
if($db->query($insql)){
	echo '<script>parent.jobsubmittatus(true)</script>';
}else{
	echo '<script>parent.jobsubmittatus(false)</script>';
}